package com.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.io.Serializable;

/**
 * @author yz
 * @data: 2022/4/7 20:20 星期四
 * @file : UserVO.java
 */

@Data
public class UserVO implements Serializable {

    private Long userId;

    private Long deptId;

    private String loginName;

    private String userName;

    private String email;

    private String phoneNumber;

    private String sex;

    private String password;

    private String salt;

    private String status;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;


    private boolean admin;

    public static boolean isAdmin(Long userId) {
        return userId != null && 1L == userId;
    }

    /**
     * userId为1 是超级管理员
     *
     * @return
     */
    public boolean isAdmin() {
        return isAdmin(this.userId);
    }

}
